package net.lesscoding.controller;

import lombok.RequiredArgsConstructor;
import net.lesscoding.Result;
import net.lesscoding.entity.order.OrderTbl;
import net.lesscoding.service.OrderService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author eleven
 * @date 2025/4/16 13:37
 * @apiNote
 */
@RestController
@RequestMapping("/order")
@RequiredArgsConstructor
public class OrderController {
    private final OrderService orderService;

    @PostMapping("/create")
    public Result<Integer> createOrder(@RequestBody OrderTbl order) {
        Integer orderId = orderService.createOrder(order);
        return Result.success(orderId);
    }
}
